#include <stdio.h>
#include "ljb.h"

void degree(AdjList G);
int main() {
	AdjList a;
	int n = 0;
	int e = 0;
	printf_s("请输入图的顶点数：");
	scanf_s("%d", &n);
	printf_s("请输入图的边数：");
	scanf_s("%d", &e);
	creat(&a, n, e);
	degree(a);
	return 0;
}

void degree(AdjList G) {
	ArcNode* p;
	int i;
	int count;
	for (i = 0; i < G.numV; i++)
	{
		count = 0;
		printf("%c", G.Vertex[i].data);
		p = G.Vertex[i].firstarc;
		while (p)
		{
			count++;
			p = p->nextarc;
		}
		printf("'s degree is %d.\n",count);
	}
}
